import {createRouter,createWebHashHistory } from "vue-router"

const router = createRouter({
    history: createWebHashHistory(''),
    routes:[
        {
            name:'',
            path:'/',
            redirect:'/home',
            component:()=>import('@/components/common/layout.vue'),
            children:[
                {
                    name:'home',
                    path:'/home',
                    component:()=>import("@/views/home.vue"),
                },
                {
                    name:'category',
                    path:'/category',
                    component:()=>import("@/views/category.vue"),
                },
                {
                    name:'find',
                    path:'/find',
                    component:()=>import("@/views/find.vue"),
                },
                {
                    name:'cart',
                    path:'/cart',
                    component:()=>import("@/views/cart.vue"),
                },
                {
                    name:'my',
                    path:'/my',
                    component:()=>import("@/views/my.vue"),
                },
            ]
        },
        {
            name:'scan',
            path:'/scan',
            component:()=>import("@/views/scan.vue"),
        }
    ]
})

export default router